﻿using System.Data.Objects;
using System.Linq;
namespace hieunv.MVC3.App.Models
{
	public partial class Customer :IDataAccess
	{
        public ObjectContext Context { get; set; }
		public Customer()
		{

		}
		public Customer(string customerID, string companyName)
		{
			CustomerID = customerID;
			CompanyName = companyName;
            Context = DataContext.Context;
		}
		public static Customer Get(string id)
		{
			Customer c =  DataContext.Context.Customers.Where(x => x.CustomerID == id).FirstOrDefault();
            c.Context = DataContext.Context;
            return c;
		}
	}
}